﻿<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<br>
<br>
<br>
<table align="left" border="0" cellpadding="0" cellspacing="0" width="90%">
    <tr>
        <td width="40%">
            <p style="font-size:13pt;font-weight:bold;text-align:left;color:#009E00;">注册用户登录</p>
            <html:form action="/user" onsubmit="return loginValidate(this);">
                <html:hidden property="action" value="login"/>
                <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%"  height="160">
                    <tr><td colspan="2"><font size="1" color="#CCCCCC">可以用:登录名/电子邮件/手机登录</font></td></tr>
                    <tr>
                        <td align="left" width="40%" height="30">登录名:</td>
                        <td>
                            <input type="text" name="loginName" value="<c:out value="${cookie['loginName'].value}"/>" size="20" style="width:120px;margin:0 0 0 0px;border:1px solid black;">
                        </td>
                    </tr>
                    <tr>
                        <td align="left" height="26">密&nbsp;&nbsp;&nbsp;码:</td>
                        <td>
                            <input type="password" name="password" value="" size="20" style="width:120px;margin:0 0 0 0px;border:1px solid black;">
                        </td>
                    </tr>
                    <tr>
                        <td align="left" height="26">验证码:</td>
                        <td>
                            <input type="text" name="vc" value="" size="4" style="width:50px;margin:0 0 0 0px;border:1px solid black;"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="<%=request.getContextPath()%>/vcimg" width="40" height="19" border="0" align="absbottom"/>
                        </td>
                    </tr>
                    <tr>
                        <td height="22">方&nbsp;&nbsp;&nbsp;&nbsp;式:</td>
                        <td align="left">
                            <c:set target="${user}" property="loginStyle" value="${cookie['loginStyle'].value}"/>
                            <html:select property="loginStyle" style="margin:0px 0px 0px 0px;font-size:10px;">
                                <html:option value="no">&nbsp;</html:option>
                                <html:option value="remember">记住登录名</html:option>
                                <html:option value="autoLogin" disabled="true">下次自动登录</html:option>
                                <html:option value="clean">清除登录设置</html:option>                                                    
                            </html:select>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <input type="submit" name="submitButt" value="" class="imageSubmitButtForAnonymousLoginAnswer" alt="登录回复">
                        </td>
                        <td>
                            <html:link page="/user.mrqa?action=findpasswordstep1">忘记密码?</html:link>
                        </td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                    </tr>
                </table>
               <c:if test="${requestScope.originalUrl != null}">
                    <input type="hidden" name="originalUrl" value='<c:out value="${requestScope.originalUrl}"/>'/>
               </c:if>
            </html:form>
        </td>
        <td width="30"></td>
        <td width="1" bgcolor="#C0C0C0"></td>
        <td width="40"></td>
        <td>
            <p style="font-size:13pt;font-weight:bold;text-align:left;color:#0066FF;">匿名回复</p>
            <html:form action="/user" onsubmit="return loginValidate(this);">
                <html:hidden property="action" value="login"/>
                <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%"  height="160">
                    <tr><td colspan="2"><font size="1" color="#CCCCCC">可以用:登录名/电子邮件/手机登录</font></td></tr>
                    <tr>
                        <td align="left" width="40%" height="30">登录名:</td>
                        <td>
                            <input type="text" name="loginName" value="<c:out value="${cookie['loginName'].value}"/>" size="20" style="width:120px;margin:0 0 0 0px;border:1px solid black;">
                        </td>
                    </tr>
                    <tr>
                        <td align="left" height="26">密&nbsp;&nbsp;&nbsp;码:</td>
                        <td>
                            <input type="password" name="password" value="" size="20" style="width:120px;margin:0 0 0 0px;border:1px solid black;">
                        </td>
                    </tr>
                    <tr>
                        <td align="left" height="26">验证码:</td>
                        <td>
                            <input type="text" name="vc" value="" size="4" style="width:50px;margin:0 0 0 0px;border:1px solid black;"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="<%=request.getContextPath()%>/vcimg" width="40" height="19" border="0" align="absbottom"/>
                        </td>
                    </tr>
                    <tr>
                        <td height="22">方&nbsp;&nbsp;&nbsp;&nbsp;式:</td>
                        <td align="left">
                            <c:set target="${user}" property="loginStyle" value="${cookie['loginStyle'].value}"/>
                            <html:select property="loginStyle" style="margin:0px 0px 0px 0px;font-size:10px;">
                                <html:option value="no">&nbsp;</html:option>
                                <html:option value="remember">记住登录名</html:option>
                                <html:option value="autoLogin" disabled="true">下次自动登录</html:option>
                                <html:option value="clean">清除登录设置</html:option>                                                    
                            </html:select>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <input type="submit" name="submitButt" value="" class="imageSubmitButtForAnonymousAnswer" alt="匿名回复">
                        </td>
                        <td>
                            <html:link page="/user.mrqa?action=findpasswordstep1">忘记密码?</html:link>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">(匿名回复不增加积分)</td>
                    </tr>
                </table>
               <c:if test="${requestScope.originalUrl != null}">
                    <input type="hidden" name="originalUrl" value='<c:out value="${fn:replace(requestScope.originalUrl,'anonymous=false','anonymous=true')}"/>'/>
               </c:if>
            </html:form>
        </td>            
            <script type="text/javascript">
                function anonymouslyAnswerValidate(pForm)
                {
                    if(pForm.vc.value == "" || pForm.vc.value.length < 4)
                    {
                        alert("[验证码]必须填写正确");
                        pForm.vc.focus();
                        return false;
                    }
                    try
                    {
                        pForm.submitButt.disabled = true;
                    }
                    catch(err)
                    {
                        alert(err.description);
                    }
                    return true;
                }
                function loginValidate(pForm)
                {
                    if(pForm.vc.value == "" || pForm.vc.value.length < 4)
                    {
                        alert("[验证码]必须填写正确");
                        pForm.vc.focus();
                        return false;
                    }
                    if(pForm.loginName.value == "")
                    {
                        alert("[登录名]必须填写正确");
                        pForm.loginName.focus();
                        return false;
                    }
                    if(pForm.password.value == "")
                    {
                        alert("[密码]必须填写正确");
                        pForm.password.focus();
                        return false;
                    }
                    pForm.submitButt.disabled = true;
                    return true;
                }
            </script>
    </tr>    
</table>
<br>
<br>
<br>